package com.hdsx.jxcsxm.log.server.impl;

import com.hdsx.dao.query.base.BaseOperate;
import com.hdsx.jxcsxm.log.bean.DurationBean;
import com.hdsx.jxcsxm.log.bean.SysLog;
import com.hdsx.jxcsxm.log.server.LoggingBranchServer;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 占贤银
 * time 2023/8/17 9:55
 * description 生命之灯因热情而点燃，生命之舟因拼搏而前行
 */
@Service
public class LoggingBranchServerImpl extends BaseOperate implements LoggingBranchServer {

    public LoggingBranchServerImpl() {
        super("sysLogging", "jdbc");
    }

    @Override
    public boolean insertSysLog(SysLog sysLog) {
        int count = insert("insertSysLog", sysLog);
        if (count > 0) {
            return true;
        }
        return false;
    }

    @Override
    public List<DurationBean> queryDurationByTruename(String truename) {
        return queryList("queryDurationByTruename", truename);
    }

    @Override
    public int insertDurationByTruename(DurationBean durationBean) {
        return insert("insertDurationByTruename", durationBean);
    }

    @Override
    public int updateDurationByTruename(DurationBean durationBean) {
        return update("updateDurationByTruename", durationBean);
    }
}
